<template>
  <a-checkbox v-model:checked="checked" @change="changeCheckbox">{{ title }}</a-checkbox>
</template>
<script lang="ts" setup>
  import { ref } from "vue"
  const props = defineProps({
    value: Boolean,
    item: {
      type: Object,
      default: () => ({}),
    },
    title: {
      type: String,
      default: "",
    },
  })
  const emit = defineEmits(["callback"])
  // 绑定状态
  const checked = ref(props.value)
  // 触发事件
  const changeCheckbox = (e) => {
    props.item.visible = e.target.checked
  }
</script>
